<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Inacap-Curico</title>
        <link type="text/css" href="<?=base_url();?>jquery_ui/css/cupertino/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="<?=base_url();?>jquery_ui/js/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="<?=base_url();?>jquery_ui/js/jquery-ui-1.8.23.custom.min.js"></script>
        <link type="text/css" href="<?=base_url();?>CSS/login.css" rel="stylesheet"/>
        <script type="text/javascript">
            $(document).ready(function(){
                base_url = '<?=base_url();?>index.php/';
                $("#btn1").button().click(function(){
                    
                    $.post(
                        base_url+'welcome/Login',
                        {nickname:$("#usuario").val(),clave:$("#clave").val()},
                        function(data){
                            if(data.msj=="false")
                            {
                                $("#msj").html("<p>Usuario no registrado!</p>");
                                $("#msj").show("fast");
                            }
                            else{
                                $("#login").hide('fast');
                                $.ajax({
                                    url: base_url+'welcome/cargaRegistro',
                                    cache:false,
                                    success:function(htmlresponse,data){
                                        $("#registro").html(htmlresponse,data);
                                        $("#registro").show('slow');
                                    }
                                });
                            }
                        },"json"
                    );
                });
            });
        </script>
    </head>
    <body>
        <div id="login" style="display:block;">
            <div id="entradas">
                <input class="uno" id="usuario" type="text" size="25"/>
                <input class="uno" id="clave" type="password" size="25"/>
            </div>
            <div id="msj" style="display:none;"></div>
            <button id="btn1">Conectar</button>
        </div>
        <div id="registro" style="display:none">
        </div>
    </body>
</html>